@import '../bootstrap'
@import '../theme'

/* Theme */
table($material)
  background-color: $material.cards
  color: $material.text.primary

  tr:not(:last-child)
    border-bottom: 1px solid rgba($material.fg-color, $material.divider-percent)

  thead
    th
      color: rgba($material.text-color, $material.secondary-text-percent)

    &:last-of-type
      border-bottom: 1px solid rgba($material.fg-color, $material.divider-percent)

  tbody
    tr
      &[active]
        background: $material.table.active

      &:hover
        background: $material.table.hover

  tfoot
    tr
      border-top: 1px solid rgba($material.fg-color, $material.divider-percent)

theme(table, "table")

.table
  &__overflow
    width: 100%
    overflow-x: auto
    overflow-y: hidden

table.table
  border-radius: 2px
  border-collapse: collapse
  border-spacing: 0
  width: 100%
  max-width: 100%

  thead, tbody
    td, th
      &:not(:nth-child(1)), &:first-child
        padding: 0 24px

  thead
    tr
      height: 56px

    th
      font-weight: 500
      font-size: 12px
      transition: .3s $transition.swing
      white-space: nowrap
      user-select: none

      &.sortable
        pointer-events: auto

      > div
        width: 100%

  tbody
    tr
      transition: background $primary-transition
      will-change: background

    td, th
      height: 48px

    td
      font-weight: 400
      font-size: 13px

  .input-group--selection-controls
    padding: 0

    .input-group__details
      display: none

    &.checkbox
      .icon
        left: 50%
        transform: translateX(-50%)

      .input-group--selection-controls__ripple
        left: 50%
        transform: translate3d(-50%, -50%, 0)
  tfoot
    tr:not(:last-child)
      height: 48px

      &:not(:only-child)
        td
          padding: 0 24px

    tr
      height: 56px
